#ifndef FREYACOMMANDDISTRIBUTION_H
#define FREYACOMMANDDISTRIBUTION_H

#include "freyabasedata.h"
#include <QThread>
#include <QQueue>
#include <QMutex>
#include <QMutexLocker>
#include <QSemaphore>

class FreyaBaseControl;
class FreyaCommandDistribution : public QThread
{
    Q_OBJECT
public:
    explicit FreyaCommandDistribution(FreyaBaseControl *pControl);

    bool InsertData(FreyaData pData);
    bool HasData();
    FreyaData TakeData();

protected:
    virtual void run();

private:
    FreyaBaseControl                *m_pControl;
    QQueue<FreyaData>               m_DataQueue;
    QMutex                          m_QueueMutex;
    QSemaphore                      m_TaskSem;
};

#endif // FREYACOMMANDDISTRIBUTION_H
